<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button></button>
    <button></button>
    <button></button>
    <button></button>
    <button></button>
    <script>
        // 1.将数组拆分成以逗号分隔的参数序列
        let arr = [1, 2, 3, 4];
        console.log(1, 2, 3, 4); //1234
        console.log(...arr); //1 2 3 4
        // 2.合并数组
        var arr1 = [1, 2, 3, 4];
        var arr2 = [5, 5, 3, 2];
        var arrs = [...arr1, ...arr2];
        console.log(arrs); // [1, 2, 3, 4, 5, 5, 3, 2]
        // 3.利用扩展运算符将伪数组转换为真正的数组
        var buttons = document.querySelectorAll('button');
        console.log(buttons instanceof Array); //伪数组，返回false
        var buttonsTrue = [...buttons];
        console.log(buttonsTrue instanceof Array); //真数组，返回false
    </script>
</body>

</html>